/**
 *
 */
package anysware.file;

import java.util.Collection;

import org.springframework.transaction.annotation.Transactional;

import anysware.file.dao.FileItemDao;
import anysware.source.Source;

/**
 * TODO: doc me
 *
 * @author keke<keke@codehaus.org>
 * @revision $Revision: 111 $
 * @version
 */
public class DefaultFileItemService implements FileItemService {
	private FileItemDao	fileItemDao;

	@Transactional(readOnly = true)
	public Collection<FileItem> getChangedFileItems() {
		return fileItemDao.getChangedFileItems();
	}

	@Transactional(readOnly = true)
	public Collection<FileItem> getChangedFileItems(final Source source) {
		return fileItemDao.getChangedFileItems(source);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see anysware.file.FileItemService#save(anysware.file.FileItem)
	 */
	@Transactional(readOnly = false)
	public FileItemService save(final FileItem fileItem) {
		fileItemDao.save(fileItem);
		return this;
	}

	/**
	 * @param fileItemDao
	 *            the fileItemDao to set
	 */
	public void setFileItemDao(final FileItemDao fileItemDao) {
		this.fileItemDao = fileItemDao;
	}

}
